<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>门诊医师</title>
  <!-- Bootstrap -->

  <link href="../static/cs  <link href="../static/css/bootstrap.min.css" rel="stylesheet">
  <!-- Font Awesome -->
  <link href="../static/css/font-awesome.min.css" rel="stylesheet">
  <!-- NProgress -->
  <link href="../static/css/nprogress.css" rel="stylesheet">
  <!-- iCheck -->
  <link href="../static/css/green.css" rel="stylesheet">
  <!-- bootstrap-progressbar -->
  <link href="../static/css/bootstrap-progressbar-3.3.4.min.css" rel="stylesheet">
  <!-- JQVMap -->s/jqvmap.min.css" rel="stylesheet"/>
  <link href="../static/css/dropzone.min.css" rel="stylesheet">
  <!-- Custom Theme Style -->
  <link href="../static/css/custom.min.css" rel="stylesheet">

  <!-- add localcss 2016-8-18 -->
  <link href='../static/localcss/appinfoadd.css' rel='stylesheet'>
  <link href='../static/localcss/appinfolist.css' rel='stylesheet'>
</head>
<body class="nav-md footer_fixed">
<div class="container body">
  <div class="main_container">
    <div class="col-md-3 left_col menu_fixed">
      <div class="left_col scroll-view">
        <div class="navbar nav_title" style="border: 0;">
          <a href="#" class="site_title"><i class="fa fa-paw"></i> <span>APP
								BMS</span>
          </a>
        </div>

        <div class="clearfix"></div>

        <!-- menu profile quick info -->
        <div class="profile">
          <div class="profile_pic">
            <img
                    src="../static/images/img.jpg"
                    alt="..." class="img-circle profile_img">
          </div>
          <div class="profile_info">
            <span>Welcome,</span>
            <h2>${devUser.devName}</h2>
          </div>
        </div>
        <!-- /menu profile quick info -->

        <br/>

        <!-- sidebar menu -->
        <div id="sidebar-menu"
             class="main_menu_side hidden-print main_menu">
          <div class="menu_section">
            <h3>${devUser.devName}</h3>
            <ul class="nav side-menu">
              <li><a><i class="fa fa-home"></i> 挂号管理 <span
                      class="fa fa-chevron-down"></span>
              </a>
                <ul class="nav child_menu">
                  <li><a href="/registry/toRegistry">创建就诊卡</a></li>
                  <li><a href="/registry/toAddRegistry">门诊挂号</a></li>
                  <li><a href="/registry/toSelectAll">挂号信息</a></li>
                </ul></li>
            </ul>
          </div>


        </div>
        <!-- /sidebar menu -->

        <!-- /menu footer buttons -->
        <div class="sidebar-footer hidden-small">
          <a data-toggle="tooltip" data-placement="top" title="Settings">
            <span class="glyphicon glyphicon-cog" aria-hidden="true"></span>
          </a> <a data-toggle="tooltip" data-placement="top" title="FullScreen">
          <span class="glyphicon glyphicon-fullscreen" aria-hidden="true"></span>
        </a> <a data-toggle="tooltip" data-placement="top" title="Lock"> <span
                class="glyphicon glyphicon-eye-close" aria-hidden="true"></span>
        </a> <a data-toggle="tooltip" data-placement="top" title="Logout"
                href="/devUser/logout"> <span
                class="glyphicon glyphicon-off" aria-hidden="true"></span> </a>
        </div>
        <!-- /menu footer buttons -->
      </div>
    </div>

    <!-- top navigation -->
    <div class="top_nav">
      <div class="nav_menu">
        <nav>
          <div class="nav toggle">
            <a id="menu_toggle"><i class="fa fa-bars"></i>
            </a>
          </div>

          <ul class="nav navbar-nav navbar-right">
            <li class=""><a href="javascript:;"
                            class="user-profile dropdown-toggle" data-toggle="dropdown"
                            aria-expanded="false"> <img
                    src="../static/images/img.jpg"
                    alt="">${devUser.devName} <span
                    class=" fa fa-angle-down"></span> </a>
              <ul class="dropdown-menu dropdown-usermenu pull-right">
                <li><a
                        href="/devUser/logout"><i
                        class="fa fa-sign-out pull-right"></i> Log Out</a>
                </li>
              </ul>
            </li>

            <li role="presentation" class="dropdown">

              <ul id="menu1" class="dropdown-menu list-unstyled msg_list"
                  role="menu">
                <li><a> <span class="image"><img
                        src="../static/images/img.jpg"
                        alt="Profile Image"/>
										</span> <span> <span>John Smith</span> <span class="time">3
													mins ago</span> </span> <span class="message"> Film festivals used
												to be do-or-die moments for movie makers. They were where...
										</span> </a></li>
                <li><a> <span class="image"><img
                        src="../static/images/img.jpg"
                        alt="Profile Image"/>
										</span> <span> <span>John Smith</span> <span class="time">3
													mins ago</span> </span> <span class="message"> Film festivals used
												to be do-or-die moments for movie makers. They were where...
										</span> </a></li>
                <li><a> <span class="image"><img
                        src="../static/images/img.jpg"
                        alt="Profile Image"/>
										</span> <span> <span>John Smith</span> <span class="time">3
													mins ago</span> </span> <span class="message"> Film festivals used
												to be do-or-die moments for movie makers. They were where...
										</span> </a></li>
                <li><a> <span class="image"><img
                        src="../static/images/img.jpg"
                        alt="Profile Image"/>
										</span> <span> <span>John Smith</span> <span class="time">3
													mins ago</span> </span> <span class="message"> Film festivals used
												to be do-or-die moments for movie makers. They were where...
										</span> </a></li>
                <li>
                  <div class="text-center">
                    <a> <strong>See All Alerts</strong> <i
                            class="fa fa-angle-right"></i> </a>
                  </div>
                </li>
              </ul>
            </li>
          </ul>
        </nav>
      </div>
    </div>
    <!-- /top navigation -->
    <div class="right_col" role="main">
      <div class="">
        <div class="clearfix"></div>
        <div class="row">
          <div class="col-md-12">
            <div class="x_panel">
              <div class="x_title">
                <h2>
                  挂号信息管理
                </h2>
                <div class="clearfix"></div>
              </div>
              <div class="x_content">
                <form method="post" action="/appInfo/select">
                  <input type="hidden" name="type" value="1">
                  <input type="hidden" name="pageIndex" value="1"/>
                  <ul>
                    <li>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">身份证号</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input name="softwareName" type="text"
                                 class="form-control col-md-7 col-xs-12"
                                 value="${appInfo.softwareName}">
                        </div>
                      </div>
                    </li>

                    <li>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">挂号医师</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select name="flatformId" class="form-control">
                            <option value="">--请选择--</option>
                          </select>
                        </div>
                      </div>
                    </li>
                    <li>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12">挂号单状态</label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="queryCategoryLevel1" name="categoryLevel1"
                                  class="form-control">
                            <option value="0">--请选择--</option>
                          </select>
                        </div>
                      </div>
                    </li>
                    <li>
                      <button type="submit" class="btn btn-primary"> 查 &nbsp;&nbsp;&nbsp;&nbsp;询
                      </button>
                    </li>
                  </ul>
                </form>
              </div>
            </div>
          </div>
          <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
              <div class="x_content">
                <p class="text-muted font-13 m-b-30"></p>
                <div id="datatable-responsive_wrapper"
                     class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                  <div class="row">
                    <div class="col-sm-12">
                      <table id="datatable-responsive"
                             class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer dtr-inline collapsed"
                             cellspacing="0" width="100%" role="grid"
                             aria-describedby="datatable-responsive_info" style="width: 100%;">
                        <thead>
                        <tr role="row">
                          <th class="sorting_asc" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              aria-label="First name: activate to sort column descending"
                              aria-sort="ascending">挂号单编号
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              aria-label="Last name: activate to sort column ascending">
                            病人名称
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              aria-label="Last name: activate to sort column ascending">
                            性别
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              aria-label="Last name: activate to sort column ascending">
                            身份证号
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              aria-label="Last name: activate to sort column ascending">
                            就诊科室
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              aria-label="Last name: activate to sort column ascending">
                            挂号医师
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              aria-label="Last name: activate to sort column ascending">
                            挂号时间
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              aria-label="Last name: activate to sort column ascending">
                            创建时间
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              style="width: 124px;"
                              aria-label="Last name: activate to sort column ascending">
                            挂号单状态
                          </th>
                          <th class="sorting" tabindex="0"
                              aria-controls="datatable-responsive" rowspan="1" colspan="1"
                              style="width: 124px;"
                              aria-label="Last name: activate to sort column ascending">
                            操作
                          </th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${pageInfo.list}" var="i">
                          <tr role="row" class="odd">
                            <td tabindex="0" class="sorting_1">${i.softwareName}</td>
                            <td>${i.APKName}</td>
                            <td>${i.softwareSize}</td>
                            <td>${i.dataDictionaryFlatformName.valueName}</td>
                            <td>${i.appCategory1Name.categoryName}
                              -> ${i.appCategory2Name.categoryName}
                              -> ${i.appCategory3Name.categoryName}</td>
                            <td>
                              <c:choose>
                                <c:when test="${i.dataDictionaryStatusName.valueName=='已下架'}">
                            <td>
                                                                        <span style="width: 30%;background-color: red;border-radius: 3px">
                                                                                ${i.dataDictionaryStatusName.valueName}
                                                                        </span>
                            </td>
                            </c:when>
                            <c:when test="${i.dataDictionaryStatusName.valueName=='已上架'}">
                              <td>
                                                                        <span style="width: 30%;background-color: green;border-radius: 3px">
                                                                                ${i.dataDictionaryStatusName.valueName}
                                                                        </span>
                              </td>
                            </c:when>
                            <c:otherwise>
                              <td>
                                                                        <span style="width: 30%;background-color: white;border-radius: 3px">
                                                                                ${i.dataDictionaryStatusName.valueName}
                                                                        </span>
                              </td>
                            </c:otherwise>
                            </c:choose>
                            </td>

                            <td>
                              <div class="btn-group">
                                <button type="button" class="">开始问诊
                                </button>
                                <button type="button" class="">查看详情
                                </button>
                                <ul class="dropdown-menu" role="menu">
                                  <c:if test="${i.dataDictionaryStatusName.valueId==5}">
                                    <li><a href="/appInfo/standUpAndDown?id=${i.id}&status=4">上架</a></li>
                                  </c:if>
                                  <li><a class="addVersion" data-toggle="tooltip"
                                         data-placement="top" title=""
                                         data-original-title="新增APP版本信息" href="/appVersion/getAppSersionList?appId=${i.id}">新增版本</a>
                                  </li>
                                  <li><a class="modifyVersion"
                                         data-toggle="tooltip" data-placement="top"
                                         title="" data-original-title="修改APP最新版本信息"
                                         onclick="updVersion('${i.versionId}','${i.id}','${i.dataDictionaryStatusName.valueName}')">修改版本</a>
                                  </li>
                                  <li><a class="modifyAppInfo"
                                         data-toggle="tooltip" data-placement="top"
                                         title=""
                                         data-original-title="修改APP基础信息"
                                         href="#" onclick="upd('${i.id}','${i.dataDictionaryStatusName.valueName}')">修改</a></li>
                                  <li><a class="viewApp" data-toggle="tooltip"
                                         data-placement="top" title=""
                                         data-original-title="查看APP基础信息以及全部版本信息" href="/appInfo/ChaKanAppInfo?id=${i.id}">查看</a>
                                  </li>
                                  <li><a class="deleteApp" data-toggle="tooltip"
                                         data-placement="top" title=""
                                         data-original-title="删除APP基础信息以及全部版本信息" onclick="shanchu('${i.id}','${i.softwareName}')">删除</a>
                                  </li>
                                  <c:if test="${i.dataDictionaryStatusName.valueId==4 || i.dataDictionaryStatusName.valueId==2}">
                                    <li><a href="/appInfo/standUpAndDown?id=${i.id}&status=5">下架</a></li>
                                  </c:if>
                                </ul>
                              </div>
                            </td>
                          </tr>
                        </c:forEach>
                        </tbody>
                      </table>
                    </div>
                  </div>
                  <div class="row">
                    <div class="col-sm-5">
                      <div class="dataTables_info" id="datatable-responsive_info"
                           role="status" aria-live="polite">共${pageInfo.total}条记录
                        ${pageInfo.pageNum}/${pageInfo.pages}页
                      </div>
                    </div>
                    <div class="col-sm-7">
                      <div class="dataTables_paginate paging_simple_numbers"
                           id="datatable-responsive_paginate">
                        <ul class="pagination">
                          <c:if test="${pageInfo.pageNum!=pageInfo.firstPage}">
                            <li class="paginate_button previous"><a
                                    href="/appInfo/select?number=${pageInfo.firstPage}&type=1&softwareName=${appInfo.softwareName}&status=${appInfo.status}&flatformId=${appInfo.flatformId}&categoryLevel1=${appInfo.categoryLevel1}&categoryLevel2=${appInfo.categoryLevel2}&categoryLevel3=${appInfo.categoryLevel3}"
                                    aria-controls="datatable-responsive" data-dt-idx="0"
                                    tabindex="0">首页</a>
                            </li>
                            <li class="paginate_button "><a
                                    href="/appInfo/select?number=${pageInfo.prePage}&type=1&softwareName=${appInfo.softwareName}&status=${appInfo.status}&flatformId=${appInfo.flatformId}&categoryLevel1=${appInfo.categoryLevel1}&categoryLevel2=${appInfo.categoryLevel2}&categoryLevel3=${appInfo.categoryLevel3}"
                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                    tabindex="0">上一页</a>
                            </li>
                          </c:if>
                          <c:if test="${pageInfo.pageNum!=pageInfo.lastPage}">
                            <li class="paginate_button "><a
                                    href="/appInfo/select?number=${pageInfo.nextPage}&type=1&softwareName=${appInfo.softwareName}&status=${appInfo.status}&flatformId=${appInfo.flatformId}&categoryLevel1=${appInfo.categoryLevel1}&categoryLevel2=${appInfo.categoryLevel2}&categoryLevel3=${appInfo.categoryLevel3}"
                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                    tabindex="0">下一页</a>
                            </li>
                            <li class="paginate_button next"><a
                                    href="/appInfo/select?number=${pageInfo.lastPage}&type=1&softwareName=${appInfo.softwareName}&status=${appInfo.status}&flatformId=${appInfo.flatformId}&categoryLevel1=${appInfo.categoryLevel1}&categoryLevel2=${appInfo.categoryLevel2}&categoryLevel3=${appInfo.categoryLevel3}"
                                    aria-controls="datatable-responsive" data-dt-idx="7"
                                    tabindex="0">最后一页</a>
                            </li>
                          </c:if>
                        </ul>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- /page content -->
    <!-- footer content -->
    <footer>
      <div class="pull-right">©2016 All Rights Reserved.</div>
      <div class="clearfix"></div>
    </footer>
    <!-- /footer content -->
  </div>
</div>
<!-- jQuery -->
<script src="../static/js/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="../static/js/bootstrap.min.js"></script>
<!-- FastClick -->
<script src="../static/js/fastclick.js"></script>
<!-- NProgress -->
<script src="../static/js/nprogress.js"></script>
<!-- jQuery custom content scroller -->
<script src="../static/js/jquery.mCustomScrollbar.concat.min.js"></script>
<!-- Custom Theme Scripts -->
<script src="../static/js/custom.min.js"></script>
<!-- validator -->
<%--     <script src="../static/js/validator.js"></script> --%>
<!-- dropzone -->
<script src="../static/js/dropzone.js"></script>
<script src="../static/js/jquery-3.6.0.js"></script>
<script>
  $(document).ready(function () {
    //一级分类
    $.post("/appCategory/getCategoryName", {"id": null},
            function (data) {
              $("[name=categoryLevel1]").text(" ")
              var str = "<option value='0'>--请选择--</option>";
              for (var i = 0; i < data.length; i++) {
                var aa = ${appInfo.categoryLevel1 ==null?"-1":appInfo.categoryLevel1}
                        str += "<option value='" + data[i].id + "'>" + data[i].categoryName + "</option>";
              }
              $("[name=categoryLevel1]").append(str);
              $("[name=categoryLevel1]").val(${appInfo.categoryLevel1}).change();
            }, "json");
    //app状态栏
    $.post("/dataDictionary/getStatusAndFlatFormName", {
      "typeName": "APP状态"
    }, function (data) {
      $("[name=status]").text(" ")
      var str = "<option value='0'>--请选择--</option>";
      for (var i = 0; i < data.length; i++) {
        str += "<option value='" + data[i].valueId + "'>" + data[i].valueName + "</option>";
      }
      $("[name=status]").append(str);
      $("[name=status]").val(${appInfo.status});
    }, "json");
    //app所属平台栏
    $.post("/dataDictionary/getStatusAndFlatFormName", {
      "typeName": "所属平台"
    }, function (data) {
      $("[name=flatformId]").text(" ")
      var str = "<option value='0'>--请选择--</option>";
      for (var i = 0; i < data.length; i++) {
        str += "<option value='" + data[i].valueId + "'>" + data[i].valueName + "</option>";
      }
      $("[name=flatformId]").append(str);
      $("[name=flatformId]").val(${appInfo.flatformId}).change();
    }, "json");
  });

  $("[name=categoryLevel1]").change(function () {
    $.post("/appCategory/getCategoryName", {
      "id": $("[name=categoryLevel1]").val()
    }, function (data) {
      $("[name=categoryLevel2]").text("")
      var str = "<option value='0'>--请选择--</option>";
      for (var i = 0; i < data.length; i++) {
        str += "<option value='" + data[i].id + "'>" + data[i].categoryName + "</option>";
      }
      $("[name=categoryLevel2]").append(str);
      $("[name=categoryLevel2]").val(${appInfo.categoryLevel2}).change();
    }, "json")
  });
  $("[name=categoryLevel2]").change(function () {
    $.post("/appCategory/getCategoryName", {
      "id": $("[name=categoryLevel2]").val()
    }, function (data) {
      $("[name=categoryLevel3]").text(" ");
      var str = "<option value='0'>--请选择--</option>";
      for (var i = 0; i < data.length; i++) {
        str += "<option value='" + data[i].id + "'>" + data[i].categoryName + "</option>";
      }
      $("[name=categoryLevel3]").append(str);
      $("[name=categoryLevel3]").val(${appInfo.categoryLevel3});
    }, "json")
  });
  function upd(id,statusName){
    if(statusName=='审核未通过'||statusName=='待审核'){
      location.href="/appInfo/getAppInfo?id="+id;
    }else{
      alert("该APP的应用状态为["+statusName+"]不能修改");
    }
  }
  function shanchu(id,name){
    if(confirm("确定要删除吗APP应用"+name+"及其所有的版本吗?")){
      $.post("/appInfo/delAPP",{
        "id":id
      },function (data) {
        if(data>0){
          $.post("/appVersion/delAPPVersion",{
            "appId":id
          },function (data) {
            alert("删除成功");
            location.reload();
          },"text");
        }else{
          alert("删除失败");
        }
      },"text")
    }
  }
  function updVersion(versionId,id,name){
    if(versionId=="" ||versionId==null){
      alert("该APP应用无版本信息,请先添加版本信息!")
    }else if(name=='审核通过' || name=='已上架' || name=='已下架'){
      alert("该APP应用状态为【"+name+"】,不能修改其他版本信息,只可进行【新增版本】操作");
    }else{
      location.href="/appVersion/getAppVersionList?appId="+id+"&id="+versionId;
    }
  }
  if($(".zhuangTai").val()=="已上架"){
    $(".zhuangTai").css("backgroundColor","green");
  }else if($(".zhuangTai").val()=="已下架"){
    $(".zhuangTai").css("backgroundColor","red");
  }
</script>
</body>
</html>